{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# 导入numpy\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "【例1】用函数arange创建一个由0,1,2,...,9组成的一维数组。\n",
    "\n",
    "\n",
    "【分析】0,1,2,...,9是等差数列的数据，从0开始，间隔为1，使用函数arange时，参数start和step都可以用默认值，参数stop找一个比9大一点的值，可以选取10。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "【例2】用函数arange创建一个由0,2,...,8组成的一维数组。\n",
    "\n",
    "\n",
    "【分析】0,2,...,8是等差数列的数据，从0开始，间隔为2，使用函数arange时，参数step需要指定，那么参数start虽然是默认值0，但也要显示给出，参数stop找一个比8大一点的值，可以选取9或10。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "【例3】用函数arange创建一个由1,0.95,0.9,...,0.55,0.5组成的一维数组。\n",
    "\n",
    "\n",
    "【分析】1,0.95,0.9,...,0.55,0.5是递减的等差数列的数据，从1开始，间隔为-0.05，使用函数arange时，参数start和step分别指定为1和-0.05，参数stop找一个比0.5小一点的值，可以选取0.49。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
